#include <iostream>
#include "doubleChain.h"

using namespace std;

int main()
{
    doubleChain<int> y;
    y.push_back(1);
    y.push_back(2);
    y.push_back(3);
    y.push_back(4);
    y.push_back(5);
    y.push_back(6);
    
    y.print(cout);
    y.push_front(10);
    y.print(cout);

    y.pop_front();
    y.remove(4);
    y.print(cout);
    chainNode<int> *temp;

    temp = y.find(5);
    y.insert(temp, 20);
    y.print(cout);

    y.erase(temp);
    y.print(cout);
    
    y.reverse();
    y.print(cout);

    doubleChain<int> z = y;
    cout << "y clear: " << endl;
    y.clear();   
    y.print(cout);

    cout << "z: ";
    z.print(cout);
    
    doubleChain<int>::iterator iter = z.begin();
    
    for ( ; iter != z.end(); iter++)
        cout << *iter << " ";

    cout << endl;
    cout << z.length() << endl;
   
    return 0;
}